feat(miner-selfimprove): wire the historical-replay scorer into the Phase 7 calibration loop (#4248) - #5462
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-12 20:49:03 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5462 +/- ##
==========================================
+ Coverage 94.52% 94.71% +0.18%
==========================================
Files 554 555 +1
Lines 44469 44526 +57
Branches 14666 14666
==========================================
+ Hits 42034 42172 +138
+ Misses 1754 1619 -135
- Partials 681 735 +54
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Summary
runHistoricalReplayCalibrationCycle,packages/gittensory-miner/lib/calibration-run.js) that finally connects the two finished-but-unwired halves feat(miner): wire the historical-replay harness into the live Phase 7 calibration loop #3014 left apart: the deterministic replay scorer (computeObjectiveAnchor, feat(miner): objective-anchor scoring for replayed plans against revealed history #3012) and the engine's pure calibration combine contract (computePhase7CalibrationLoop, feat(miner): wire the historical-replay harness into the live Phase 7 calibration loop #3014/PR feat(engine): wire historical replay into Phase 7 calibration loop #3225).[0, 1], folds it into theHistoricalReplayCalibrationInputshape the engine expects, callscomputePhase7CalibrationLoopwith that plus the existingpr_outcomesignal, and persists the combined snapshot as acalibration_snapshotevent on the local append-only event ledger (the same typed-event-over-event-ledger.jspattern aspr-outcome.js, feat(miner-manage): local pr_outcome record writer #4274).gittensory-miner ledger list --type calibration_snapshot— and via the newreadCalibrationSnapshots/latestCalibrationSnapshotreaders. No new CLI surface was required.docs/miner-selfimprove-calibration.mdclarifying that feat(miner): wire the historical-replay harness into the live Phase 7 calibration loop #3014 shipped only the engine combine and that this runner (feat(miner-selfimprove): wire the historical-replay scorers into the Phase 7 calibration loop #4248) is what actually wires the replay scorer into it — the requested scope-clarification so the gap does not recur.Closes #4248.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run test:ci(andnpm run test:coverageunsharded) under Node 22 (.nvmrc) before pushing. The development sandbox runs Node 18 without the workspacenode_modules(the engine'sdist/is unbuilt andnode:sqliteis unavailable), so the Vitest gate could not be executed here. The new module's pure logic was verified out-of-band with a standalone Node script against the realreplay-objective-anchor.jsscorer (composite of a fully-overlapping feature task = 1.0; combined with a 0.8pr_outcomeat default 0.5/0.5 weights = 0.9) and against verbatim copies of the snapshot/normalize helpers (every accept/reject/fallback branch).packages/gittensory-miner/lib/calibration-run.jsis measured (packages/gittensory-miner/lib/**); the.d.ts,package.json, docs, andtest/**are not.calibration-run.jsis written to be pure and dependency-injected, andtest/unit/miner-calibration-run.test.tstargets 100% of its lines and branches (both sides of every guard,??, and default parameter), with the integration test covering the default engine-combine + real-ledger paths.Safety
ledger list --typepath.)UI Evidencesection below. (Not applicable — no UI changes.)CHANGELOG.mduntouched.)UI Evidence
Not applicable — this change is a miner-package runtime module + tests + package docs (Markdown). No rendered frontend surface changed.
Notes
computePhase7CalibrationLoopis a pure engine contract that cannot depend on the miner (miner → engine, not the reverse), so it correctly waited for an external caller. This runner is that caller and lives on the miner side; it measures and records only. Acting on the combined accuracy — the calibration-gated circuit-breaker — remains maintainer-only (maintainer: wire calibration accuracy into the live auto-tune circuit-breaker for miner-originated PRs #2352), as documented indocs/miner-selfimprove-calibration.md.pr_outcomehas signal; the integration test pins this.calibration_snapshottyped event mirrorspr-outcome.js'sMINER_PR_OUTCOME_EVENTover the shared append-onlyevent-ledger.js, so it inherits the ledger's immutability/JSON-verbatim guarantees and is immediately queryable withgittensory-miner ledger list --type calibration_snapshot.